Ccay.Module.define("Ccay.example.ui.pie",function(page,$S){
	page.ready=function(){
		/**
		 * setTimeout 延迟加载 0 就是0秒  用延迟加载的原因就是避免加载发生冲突
		 */
		setTimeout(function(){$("#pieTab").ccayTab()}, 100);
		
		$('#chart').chart({
			type:'pie',
			lines:[{label: '月度销售额',totalField:'profit'},
			       {label: '月度支出',totalField:true,fnSetData:function(item){
			    	   return item.total - item.profit;
			       }}
			],
			ajax:{
				url:'ccay/example/ui/chart/datas2.json'
			} 
		});
		
		$('#chart2').chart({
			type:'pie',
			lines:[{label: '<span>月度销售额</span><span>${percent}%</span>',totalField:'profit'},
			       {label: '<span>月度支出</span><span>${percent}%</span>',totalField:true,fnSetData:function(item){
			    	   return item.total - item.profit;
			       }}
			],
			linesOp:{
				 tilt: 0.5
			},
			grid:{
				hoverable:true
			},
			ajax:{
				url:'ccay/example/ui/chart/datas2.json'
			} 
		});
	};
});